﻿using AutoMapper;
using MyCompanyName.MyProjectName.Datas.Dto;
using MyCompanyName.MyProjectName.Layouts;
using MyCompanyName.MyProjectName.Layouts.Dto;
using MyCompanyName.MyProjectName.Menus;
using MyCompanyName.MyProjectName.Menus.Dto;

namespace MyCompanyName.MyProjectName
{
    public class MyProjectNameApplicationAutoMapperProfile : Profile
    {
        public MyProjectNameApplicationAutoMapperProfile()
        {
            /* You can configure your AutoMapper mapping configuration here.
             * Alternatively, you can split your mapping configurations
             * into multiple profile classes for a better organization. */
            
            CreateMap<Datas.Data, DataDto>();
            CreateMap<Menu, MenuDto>()
                .ForMember(dto => dto.Meta, map => map.MapFrom(src => src.ExtraProperties));
            CreateMap<Layout, LayoutDto>()
                .ForMember(dto => dto.Meta, map => map.MapFrom(src => src.ExtraProperties));

        }
    }
}
